<#include "/template/_layout.html" /> 

<style>
#header{
	background-image: url("${root!}/weblib/easyui/themes/${userTheme!}/images/header_bg.png");
}
.logo{
	height:60px;
	width:200px;
	background:url("${root!}/weblib/easyui/themes/${userTheme!}/images/LOG.png");
}

</style>

<script>

	function popMsg(){
		$.ajax({
			url:'./popMsg',
			type:'GET',
			success:function(msg){
				if(msg){
					FrameMsg.show(msg,'${sysMsgPosition!}',3000);
				}
			},
			error:function(XMLHttpRequest, textStatus, errorThrown){
				var stat = XMLHttpRequest.status;
				if(stat== 404 || stat==0){
					window.location=window.location.href.replace("#","");
				}
			}
		});
	}

	$(function(){
		var time = 1000*8;
		//var interval = setInterval("popMsg()",time);
	});

</script>
<@top>

<div id="header" >
	<div class="headerNav">
		<a class="logo" href="http://www.top.com"></a>
		<div class="Info">
			<ul class="head-info">
				<li><a href="./security/logout">退出</a></li>
				<li>当前用户：${cUser.username} | </li>
			</ul>
			<ul class="themeList">
				<li data-theme="red" class="red">
					<div class="red"></div>
				</li>
				<li data-theme="orange" class="orange">
					<div class="orange"></div>
				</li>
				<li data-theme="green" class="green">
					<div class="green"></div>
				</li>
				<li data-theme="blue" class="blue">
					<div class="blue"></div>
				</li>
				<li data-theme="gray" class="gray">
					<div class="gray"></div>
				</li>
				<li data-theme="default" class="default">
					<div class="default"></div>
				</li>
			</ul>
		</div>
	</div>
</div>
<div id="toolbar"  class="panel-header">
	<ul class="toolbarnav1">
		<li><a href="#" ><span class="l-tool-btn"><span class="icon-mail tool-btn">收件箱(2)</span></span></a> </li>
		<li><a href="#" ><span class="l-tool-btn"><span class="icon-report tool-btn">代办事项(2)</span></span></a> </li>
	</ul>
</div>
<script>
	$(function(){
		$('.themeList').find('li').each(function(){
			$(this).off().on("click",function(){
				var theme = $(this).data("theme");
				$.ajax({
					url:"./changeTheme/"+theme,
					success:function(){
						window.location=window.location.href.replace("#","");
					}
				});
			});
		});
	});
</script>
</@top> 

<@west>
<div id="aa" class="easyui-accordion" data-options="fit:true">
	<#list acc as a>
	<div title="${a.menuName}">
		<ul id="${a.id}" class="easyui-tree" url="./leftTree?rootId=${a.id}"></ul>
		<script type="text/javascript">
			$(function() {
				$('#${a.id}').tree({
					onClick : function(node) {
						var url = node.attributes.url;
						if(url!='@'){
							FrameTab.addTab(node.text, "${root!}"+node.attributes.url);
						}else{
							$('#${a.id}').tree('toggle',node.target);
						}
					}
				});
			});
		</script>
	</div>
	</#list>
</div>
</@west>

